#include <stdio.h>
#include <stdlib.h>

int main() {
    int* arr = (int*)malloc(10 * 4);
    for (int i = 0; i < 10; i++) {
        arr[i] = i;
    }
    for (int i = 0; i < 10; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");

    arr = (int*)realloc(arr, 5 * 4);
    
    for (int i = 0; i < 10; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");
    return 0;
}
